package com.dykj.fireFighting.web.app;

import com.dykj.fireFighting.api.base.enterprise.entity.Enterprise;
import com.dykj.fireFighting.api.base.enterprise.service.IEnterpriseService;
import com.dykj.fireFighting.common.core.annotation.AutoLog;
import com.dykj.fireFighting.common.core.api.CommonResult;
import com.dykj.fireFighting.web.base.shiro.ShiroUtil;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: zly
 * @Description :app获取单位信息
 * @Date: 2021-08-26
 */
@Slf4j
@RestController
@RequestMapping("app/userEnterpriseInfo")
public class AppUserEnterpriseInfoController {

    @DubboReference
    private IEnterpriseService enterpriseService;
    /**
     * app查询单位信息
     *
     * @return
     */
    @ApiOperation(value = "app查询单位信息", notes = "app查询单位信息")
    @GetMapping("/getEnterpriseInfo")
    public CommonResult getEnterpriseInfo() {
       Enterprise enterprise=enterpriseService.queryById(ShiroUtil.getUser().getEnterpriseId().toString());
        return CommonResult.success(enterprise,"成功");
    }
}
